package com.lusang.org.domain;

import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiParam;
import lombok.Data;
import com.lusang.basics.domain.BaseDomain;
import org.springframework.format.annotation.DateTimeFormat;

import java.util.Date;
import java.util.List;

@Data
public class Department extends BaseDomain {
    @ApiParam(value = "名字",required = true) //打在属性上 对属性做描述
    private String name;
    @ApiParam(value = "简介",required = true) //打在属性上 对属性做描述
    private String intro;
    @ApiParam(value = "创建时间",required = true) //打在属性上 对属性做描述
    private Date create_time;
    @ApiParam(value = "更新时间",required = true) //打在属性上 对属性做描述
    private Date update_time;
    @ApiParam(value = "路径",required = true)
    private String path;
    @ApiParam(value = "状态",required = true)
    private Integer state = 1;
//    private Long manager_id;
//    private Long parent_id;

    @JsonFormat(pattern = "yyyy-MM-dd hh:mm:ss",timezone = "GMT+8")
    public Date getCreate_time() {
        return create_time;
    }
    @DateTimeFormat(pattern = "yyyy-MM-dd hh:mm:ss")
    public void setCreate_time(Date create_time) {
        this.create_time = create_time;
    }
    @JsonFormat(pattern = "yyyy-MM-dd hh:mm:ss",timezone = "GMT+8")
    public Date getUpdate_time() {
        return update_time;
    }
    @DateTimeFormat(pattern = "yyyy-MM-dd hh:mm:ss")
    public void setUpdate_time(Date update_time) {
        this.update_time = update_time;
    }

    //部门经理
    @ApiParam(value = "部门经理",required = true) //打在属性上 对属性做描述
    private Employee manager;
    //父级部门
    @ApiParam(value = "父级部门",required = true) //打在属性上 对属性做描述
    private Department parent;
    //子集部门
    @ApiParam(value = "子集部门",required = true) //打在属性上 对属性做描述
    private List<Department> children;
    @Override
    public String toString() {
        return "Department{" +
                "id=" + this.getId() +
                ", name='" + name + '\'' +
                ", intro='" + intro + '\'' +
                ", create_time=" + create_time +
                ", update_time=" + update_time +
                '}';
    }
}
